import router from './index.js';

//  白名单
const list = ['/login'];
router.beforeEach((to, from, next) => {
  if (list.indexOf(to.path) !== -1) {
    next();
  } else {
    const token = window.sessionStorage.getItem('token');
    if (token) {
      next();
    } else {
      next('/login');
    }
  }
});
